/*
 * GoogleTranslateJavaMESample1.java
 * Created on 28 February 2009, 22:30 by Jinath Sanjitha
 */

package test;

import com.google.api.javame.*;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;

/*
 *@ author Jinath Sanjitha
 */
public class GoogleTranslateJavaMESample1 extends MIDlet {

    private TextBox tb;

    /**Show the translated output in a TextBox in the Mobile Phone Screen*/
    public void startApp() {
        tb = new TextBox("Google Translate API for JavaME", "", 500, TextField.ANY);
        try {
            String translatedText = Translate.translate("How are you", Language.ENGLISH, Language.FRENCH);
            tb.setString(translatedText);
            Display.getDisplay(this).setCurrent(tb);
        } catch (Exception e) {
            /*log error*/
        }
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
